package com.demo.matchfind;

import com.demo.common.Dish;
import com.demo.common.DishUtil;

import java.util.List;

public class TestAllMatch {
    public static void main(String[] args) {
        List<Dish> menu = DishUtil.getDishes();
        boolean isHealthy = menu.stream()
                                 .allMatch(d -> d.getCalories() < 1000);
        System.out.println("The menu is " + (isHealthy ? "" : " not ") + "healthy");
    }
}
